<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="https://unpkg.com/vue@next"></script>
</head>
<body>
    <div id="app">
        <anchored-heading :level='2'>Hello World</anchored-heading>
    </div>

    <script>
        const AppComp = {

        }

        const AnchoredHeadingComp = {
            props:{
                level:{
                    type:Number,
                    required:true
                }
            },
            template:`
                <h1 v-if='level===1'>
                    <slot></slot>
                </h1>
                <h2 v-else-if='level===2'>
                    <slot></slot>
                </h2>
                <h3 v-else-if='level===3'>
                    <slot></slot>
                </h3>
                <h4 v-else-if='level===4'>
                    <slot></slot>
                </h4>
                <h5 v-else-if='level===5'>
                    <slot></slot>
                </h5>
                <h6 v-else-if='level===6'>
                    <slot></slot>
                </h6>
            `
        }

        const app = Vue.createApp(AppComp)
        app.component("anchored-heading",AnchoredHeadingComp)
        const vm = app.mount('#app')
    </script>
</body>
</html>